<?php

class CronCommand extends CConsoleCommand
{
	public function run($argv)
	{
		$line = system('hddtemp /dev/sda');
		//   /dev/sda: Hitachi HDP725050GLA360: 46°C
		$words = explode(':', $line);
		$degree = substr(ereg_replace('[ ]', '', $words[2]),0,2);

		$model = new Hddtemp;
		$model->temp = $degree;
		$model->save();
	}
}
